//
//  LegalAdviceViewController.m
//  DJS
//
//  Created by 浪尖渝力 on 2018/1/22.
//  Copyright © 2018年 mac. All rights reserved.
//

#import "LegalAdviceViewController.h"
#import "LegalAdviceView.h"

@interface LegalAdviceViewController ()

@property(nonatomic,strong)LegalAdviceView *aView;


@end

@implementation LegalAdviceViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title=@"咨询详情";
    _aView=[LegalAdviceView new];
    [self.view addSubview:_aView];
    [_aView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.bottom.mas_equalTo(0);
    }];
    _aView.customSelectedBlock = ^{
        [ZQTools cleanViewSubviews:_aView];
        [self loadDate];
    };
  
    _aView.viewController=self;
  
}
-(void)viewWillAppear:(BOOL)animated{
    [ZQTools cleanViewSubviews:self->_aView];
    [self loadDate];
}
-(void)loadDate{
    
    NSDictionary *userDic = [NSKeyedUnarchiver unarchiveObjectWithFile:_userModelFile];
    NSString *token=[userDic objectForKey:@"token"];
    NSNumber *waiter_id1=[userDic objectForKey:@"waiter_id"];
    NSString *waiter_id=[NSString stringWithFormat:@"%@",waiter_id1];
    
    NSDictionary *dic=[NSDictionary dictionaryWithObjectsAndKeys:[NSString stringWithFormat:@"%@",_consult_id],@"consult_id",token,@"token",waiter_id,@"waiter_id",@"1",@"user_role", nil];
    [ZQTools AFNPostDataUrl:@"waiter/consult/consult_info" Dict:dic andTableView:nil andViewController:self andSuccessBlock:^(id responseObject) {
        _aView.dic=responseObject;
        
        [_aView creatView];
    } anderrorBlock:nil];
}
-(void)viewWillDisappear:(BOOL)animated{
    [_aView.player stop];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
